import request from '@/axios';

export const getList = (params) => {
  return request({
    url: '/position/position/list',
    method: 'get',
    params
  });
};

export const getDetail = id => {
  return request({
    url: '/position/position/detail',
    method: 'get',
    params: {
      id,
    },
  });
};

export const remove = ids => {
  return request({
    url: '/position/position/remove',
    method: 'post',
    params: {
      ids,
    },
  });
};

export const add = row => {
  return request({
    url: '/position/position/save',
    method: 'post',
    data: row,
  });
};

export const update = row => {
  return request({
    url: '/position/position/update',
    method: 'post',
    data: row,
  });
};

export const publish = (ids) => {
  return request({
    url: '/position/position/publish',
    method: 'post',
    params: {
      ids,
    },
  });
};

export const unpublish = (ids) => {
  return request({
    url: '/position/position/unPublish',
    method: 'post',
    params: {
      ids,
    },
  });
};

export const sort = (row) => {
  return request({
    url: '/position/positionInstance/sort',
    method: 'post',
    data: row
  })
}